home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
prolog
/
ai.prl
/
opnprlg1.hqx
/
Open Prolog
/
Samples
/
rooms
< prev
next >
Wrap
Text File
|
1993-02-17
|
246b
|
21 lines
door(a,b).
door(b,e).
door(b,c).
door(d,e).
door(c,d).
door(e,f).
door(g,e).
has_phone(g).
go(X,X,_,[]).
go(X,Y,T,[Z|R]):-
Y\==X,
(door(X,Z) ; door(Z,X)),
not member(Z,T),
go(Z,Y,[Z|T],R).
member(X,[X|_]).
member(X,[_|R]) :- member(X,R).